var v = new Vue({
    el: '#text',
    data: {
        cpuNum: 0,
        cpuTotal: 0,
        cpuUsed: 0,
        cpuSys: 0,
        cpuFree: 0,
        cpuWait: 0,
        ncTotal: 0,
        ncUsed: 0,
        ncFree: 0,
        ncUsage: 0,
        jvmTotal: 0,
        jvmUsed: 0,
        jvmFree: 0,
        jvmUsage: 0,
        computerName: "",
        osName: "",
        computerIp: "",
        osArch: "",
        name: "",
        version: "",
        startTime: "",
        runTime: "",
        home: "",
        userDir: "",
        cps: []
    }
})

$.ajax({
    url: "/system/jk", //请求的url地址
    dataType: "json", //返回格式为json
    contentType: 'application/json;charset=utf-8', //请求数据类型
    async: true, //请求是否异步，默认为异步，这也是ajax重要特性
    type: "GET", //请求方式
    success: function (res) {
        v.cpuNum = res.cpu.cpuNum,
        v.cpuTotal = res.cpu.total,
        v.cpuUsed = res.cpu.used,
        v.cpuSys = res.cpu.sys,
        v.cpuFree = res.cpu.free,
        v.cpuWait = res.cpu.wait,
        v.ncTotal = res.mem.total,
        v.ncUsed = res.mem.used,
        v.ncFree = res.mem.free,
        v.ncUsage = res.mem.usage,
        v.jvmTotal = res.jvm.total,
        v.jvmUsed = res.jvm.used,
        v.jvmFree = res.jvm.free,
        v.jvmUsage = res.jvm.usage,
        v.computerName = res.sys.computerName,
        v.osName = res.sys.osName,
        v.computerIp = res.sys.computerIp,
        v.osArch = res.sys.osArch,
        v.name = res.jvm.name,
        v.version = res.jvm.version,
        v.startTime = res.jvm.startTime,
        v.runTime = res.jvm.runTime,
        v.home = res.jvm.home,
        v.userDir = res.sys.userDir,
        v.cps = res.sysFiles
    }
});
